<?php
namespace app\user\controller;
use think\Input;
class Index extends Common{
    public function initialize(){
        parent::initialize();

    }
    public function index(){
        $this->assign('title','会员中心');
		//获取所有的用户信息
		$user=db('users')->where('id='.$_SESSION['think']['user']['id'])->find();
        $lname=db('user_level')->where('level',$user['level'])->value('level_name');
        $is_wang=db('users')->where(array('uid'=>$_SESSION['think']['user']['id'],'is_b'=>0))->count();
        $money_config=db('money_config')->where('id','gt',0)->select();
        $sys=getsystem();
		$this->assign('user',$user);
		$this->assign('money_config1',$money_config[0]);
		$this->assign('money_config2',$money_config[1]);
		$this->assign('money_config3',$money_config[2]);
		$this->assign('tuijian',$sys['tuijian']);
		$this->assign('wlt',$sys['wlt']);
		$this->assign('is_wang',$is_wang);
		$this->assign('sys',$sys);
		$this->assign('lname',$lname);
        return $this->fetch();
    }
    public function Chat(){
    	$userId = $_SESSION['think']['user']['mobile'];
    	$chatUrl = "http://test.jinhengyy.com/home/Chat/index?mobile=$userId";
        $this->redirect($chatUrl);

    }
}